<template>
  <div class="introduction">
    <div v-if="!isEdit" class="int-content">
      {{myIntroduce}}
    </div>
    <div v-else class="edit">
      <el-input
          style="width: 100%"
          type="textarea"
          :rows="6"
          placeholder="请输入自我介绍"
          v-model="edit">
      </el-input>

    </div>
  </div>
</template>

<script>
import {putResume} from "@/api/resume";

export default {
  name: "introduction",
  props:["myIntroduce","resumeId"],
  data(){
    return{
      edit:'',
      isEdit:false
    }
  },
  methods:{
    editHandle(){
      this.isEdit=true
      this.edit=this.myIntroduce
    },
    saveHandle(){
      putResume({summarize:this.edit,id:this.resumeId}).then(res=>{
        this.myIntroduce=this.edit
        this.isEdit=false
        this.$message.success("已保存~")
      })

    }
  }
}
</script>

<style lang="stylus" scoped>
.add-ex
  height 40px
  display flex
  justify-content center
  align-items center
  & i
    cursor pointer
    font-size 30px
    background #07c160
    border-radius 50%
    color #f7faf9
    margin 0 10px
.content-edit
  height auto
  min-height 150px
  width 100%
.int-content
  word-break break-all
</style>
